Week 4: Incumbancy and Election Outcomes

## Rows: 29521 Columns: 12
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): State and area
## dbl (11): Count, FIPS Code, Year, Month, Population, LaborForce, LaborForce_...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## New names:
## Rows: 37 Columns: 21
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (4): AreaAll, winner_party, president_party, H_incumbent_party
## dbl (16): ...1, year, R_seats, D_seats, Other_seats, total_votes, R_votes, D...
## lgl  (1): H_incumbent_party_winner
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## New names:
## Rows: 298 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): DATE, year_qt
## dbl (7): ...1, ...2, UNRATE, year, quarter_yr, quarter_cycle, unrate_qt_total
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## New names:
## Rows: 254 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): date, year_qt
## dbl (7): ...1, year, quarter_yr, quarter_cycle, DSPIC_qt, DSPIC_change_qt, D...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## New names:
## Rows: 761 Columns: 7
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl  (3): DSPIC96, quarter_yr, quarter_cycle
## lgl  (3): ...5, ...6, ...7
## date (1): date
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Rows: 16067 Columns: 31
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (16): Office, State, Area, RepCandidate, RepStatus, DemCandidate, DemSta...
## dbl (14): raceYear, RepVotes, DemVotes, ThirdVotes, OtherVotes, PluralityVot...
## lgl  (1): CensusPop
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Expert Ratings

In my previous blogs, I have focused solely at national variables and conditions which may affect our election outcomes. Things like GDP, unemployment, polling, etc. are very helpful tools but we also have the option to look at elections from a much closer, district level approach. On the district level, many experts watch and weigh in on important races. Organizations such as Cook Political Report and Sabato’s Crystal Ball take into account local conditions and determine ratings on an individual district level basis. These ratings are usually considerably accurate, with over 96% of House of Representative elections being accurately predicted between 1998 and 2016 (Silver, 2022). In this blog post, I will evaluate my existing model with the inclusion of incumbency and expert rating data. I will also create another model to visualize actual vote share to various expert predictions for a particular year, I will chose 2018.

## Reading layer `districts114' from data source 
##   `/private/var/folders/mv/pwxqfd411cz090w_kkkl3mn00000gn/T/RtmpViYfTL/districtShapes/districts114.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 436 features and 15 fields (with 1 geometry empty)
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: -179.1473 ymin: 18.91383 xmax: 179.7785 ymax: 71.35256
## Geodetic CRS:  NAD83

Visualizing Vote Share Outcomes with Expert Predictions

District Level Predictions Map

This is for blog extension 1. I will evaluate the accuracy of the expert predictions to the actual results by subtracting the difference between the average margin and the actual margin.

## [1] 2498.577 ## [1] 2624.577

On average, according to this data, there are 200 more cases of positive differences. This indicates that in 2018 experts were more likely to underestimate Democratic candidates in races.

Updating My Existing Model

One complication in aggregating district level data to my very national level model is trying to figure out what imputs make sense. As I thought about this, I realized there’s no great way of doing it simply while also being accurate. For now, I am using whether or not its true that the incumbent party won or not. In the next week with more time and experience I hope to do this on an individual rather than national level.

Adding incumbency only improved my model’s r-squared by 0.02, and there isn’t much change in the fit. However, this will likely change on an individual district level and my choice of seats for my model makes it hard to find a good local metric.

Observations 31
Dependent variable D_seats
Type OLS linear regression
F(4,26) 7.72
0.54
Adj. R² 0.47
Est. S.E. t val. p
(Intercept) 273.43 21.36 12.80 0.00
GDP_growth_qt -0.02 0.02 -1.08 0.29
DSPIC_qt -0.00 0.00 -3.28 0.00
UNRATE -0.88 2.83 -0.31 0.76
DemIncumbent 13.34 13.04 1.02 0.32
Standard errors: OLS

See also